

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
	<g:set var="scale" value="${0.8F/16L}" scope="page" />
	<style type="text/css">
<!--
  /* floating thumbs */
.thumbnail
{
  float: left;
  width: 12em;
  height: 14em;
  border: 1px solid #d4d4d4; /* #999; */
  margin: 0 1em 1em 0;
  padding: 0.3em;
}
.thumbnail a {
  font-size: 100%;
}
.paginateButtons {
  clear: left;
}
.submitChoice {
  clear: left;
  margin-bottom: 1em;
}
.fixedControl a {
  position: fixed;
  bottom: 1.8em;
  right: 3em;
  opacity: 0.75;
  background-color: #fff;
  color: #000;
}

-->
	</style>
        <title>Piece Sort</title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLinkTo(dir:'')}">Home</a></span>
            <span class="menuButton"><g:link class="create" action="create">New Piece</g:link></span>
	    <span class="menuButton"><g:link class="home" action="flashMe">Flash</g:link></span>
        </div>
        <div class="body">
            <h1>Piece Sort</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>

	    <g:form name="choices" url="[action:'sort',controller:'piece']">
            <div>
<g:each in="${pieceList}" status="i" var="demo">
  <div class="thumbnail"><label for="cb${demo.id}"><img src="${demo.simpleEntry?.thumbnailURL}" style="width:${demo.simpleEntry?.thumbnailWidth?.asType(Float)*scale}em; height:${demo.simpleEntry?.thumbnailHeight?.asType(Float)*scale}em;"/></label><br/>
    <g:link action="show" id="${demo.id}">Show</g:link>&nbsp;<g:checkBox name="cb${demo.id}"/><label for="cb${demo.id}">Tag</label>
  </div>
</g:each>
	    </div>
	    <br/>
	    <div class="submitChoice">
                <g:submitButton name="updateChoices" value="Submit Tags"/>
	    </div>
	    </g:form>

            <div class="paginateButtons">
                <g:paginate total="${Piece.count()}" />
            </div>
	    <div class="fixedControl">
	        <g:link action="sort" params="[offset:(params.offset?params.offset.toLong():0)+(params.max?params.max.toLong():0),max:params.max]" class="nextLink" accesskey="z">Next [Z]</g:link>
	    </div>
        </div>
    </body>
</html>
